#include <stdio.h>
#include <stdlib.h>
void main() 
{
    int time[7];//这是一个数组，定义了7个变量：time[0]、time[1]、time[2]、time[3]、time[4]、time[5]、time[6]
    //输入七个变量
    for (int i = 0; i < 7; i++)
    {
        printf("please enter time[%d]: ", i);
        scanf("%d", &time[i]);
        printf("time[%d]=%d\n", i, time[i]);
    } 
    printf("time[0]=%d,time[1]=%d,time[2]=%d,time[3]=%d,time[4]=%d,time[5]=%d,time[6]=%d\n", time[0],time[1],time[2],time[3],time[4],time[5],time[6]);

    //冒泡排序
    int temp;
    for (int i = 0; i < 7; i++)
    {
        for (int j = i+1; j < 7; j++)
        {
            if (time[i]>time[j])
            {
               temp    = time[j];
               time[j] = time[i];
               time[i] = temp;
            }   
        }  
    }
    printf("time[0]=%d,time[1]=%d,time[2]=%d,time[3]=%d,time[4]=%d,time[5]=%d,time[6]=%d\n", time[0],time[1],time[2],time[3],time[4],time[5],time[6]);
    system("pause");
}